home *** CD-ROM | disk | FTP | other *** search
/ Mission 3 / Mission 3.zip / Mission 3.iso / tools / facevalu / examples / ex / ex.txt next >
Text File  |  1995-11-19  |  6KB  |  207 lines

  1. This is a demo program created with Face Value 1.0. The RSC-file was 
  2. loaded into Face Value, some flags were set, and Face Value produced 
  3. a LST file for GFA Basic 3.x. You are now watching the result. All of 
  4. the code added afterwards to this LST-file by the user is listed below:
  5.  
  6. Added in the procedure @user_rsc_interact():
  7. --------------------------------------------
  8.   ~@win_open_dialog(2,about_dialog&,iconify_icon_1&)
  9.   ~@win_open_dialog(5,modal&,iconify_icon_1&)
  10.   ~@win_open_dialog(2,non_modal&,iconify_icon_1&)
  11.   ~@win_open_dialog(3,toolbox&,iconify_icon_1&)
  12.   ~@win_open_dialog(4,fvt_asci&,iconify_icon_1&)
  13.  
  14.   ~@win_open(" Standard window ","  Info line...",simple_window%,backgrnd&,
  15.              800,800,16,0,0,0,800,800,iconify_icon_1&)
  16.   ~@win_open(" Toolstrip window ","",toolstrip_window%,toolstrip&,
  17.              800,800,16,0,0,0,800,800,iconify_icon_1&)
  18.   ~@win_open(" Toolbar window ","",toolbar_window%,toolbar&,800,800,
  19.              16,0,0,0,800,800,iconify_icon_1&)
  20.  
  21.   @win_close_all
  22.   @win_close(window_array&(index&,0))
  23.  
  24.   @win_iconify(-1)
  25.   @win_iconify_all
  26.   @win_uniconify(-1)
  27.   @win_uniconify_all
  28.   @win_cycle
  29.  
  30.   @rsc_set_new_menu(menu&)
  31.   @rsc_set_new_menu(menu_2&)
  32.  
  33.   @desktop_new(desktop&,desklogo&)
  34.   @desktop_restore
  35.  
  36.   a$=@fileselector$("Fileselector with title!:",program_path$,"",0)
  37.  
  38.   IF @alert_wind(1,alert_1&,"")=1
  39.     IF @alert_wind(1,alert_2&,"")=1
  40.       ~@alert_wind(1,alert_3&,"")=1
  41.     ENDIF
  42.   ENDIF
  43.  
  44.   @progress_open(-1)
  45.   FOR albert&=0 TO 1000
  46.     EXIT IF @progress_update(INT(albert&/10))
  47.   NEXT albert&
  48.   @progress_close
  49.  
  50.   time&=@busy_open(TRUE)
  51.   FOR a&=0 TO 4000
  52.     EXIT IF @busy_update(time&)
  53.   NEXT a&
  54.   @busy_close
  55.  
  56.   @open_text_window    !****** Calls to procedures written for this demo,
  57.   @change_font(index&) !****** see bottom of text.
  58.  
  59.   @aes_screen_lock
  60.   FOR a&=0 TO 80
  61.     @mouse_busy(2)
  62.     ~EVNT_TIMER(100)
  63.   NEXT a&
  64.   @mouse_form(-1)
  65.   @aes_clear_buffers
  66.   @aes_screen_unlock
  67.  
  68.  
  69. Changed/added in the procedure @user_rsc_var_init:
  70. --------------------------------------------------
  71.   DIM lstbx_radio_arr$(23)
  72.   LET lstbx_radio_ndx&=24 
  73.   LET lstbx_radio_var&=1
  74.   FOR a&=0 TO 23
  75.     lstbx_radio_arr$(a&)="Radio "+STR$(a&)
  76.   NEXT a&
  77.  
  78.   DIM chcklist_arr$(23)
  79.   DIM chcklist_arr!(23)
  80.   LET chcklist_ndx&=24 
  81.   FOR a&=0 TO 23
  82.     chcklist_arr$(a&)="Check "+STR$(a&)
  83.   NEXT a&
  84.  
  85.   DIM list_menu_box_arr$(23)
  86.   LET list_menu_box_ndx&=24
  87.   FOR a&=0 TO 23
  88.     list_menu_box_arr$(a&)="Menu "+STR$(a&)
  89.   NEXT a&
  90.  
  91.  
  92. Added in the procedure procedure @user_keyb():
  93. ----------------------------------------------
  94.   @win_keyb_scroll(handle&,ks&,key&)
  95.  
  96.  
  97. Added in the procedure @user_window_content():
  98. ----------------------------------------------
  99.   LOCAL a&,b&,x&,y&,w&,h&
  100.   SELECT userhandle&
  101.   CASE 42
  102.     @win_get_workarea(index&,x&,y&,w&,h&)
  103.     y&=0
  104.     b&=DIV(off_y&,window_array&(index&,29))
  105.     x&=SUB(window_array&(index&,28),off_x&)
  106.     FOR a&=b& TO ADD(b&,DIV(h&,window_array&(index&,29)))
  107.       TEXT x&,y&,txt$(a&)
  108.       ADD y&,window_array&(index&,29)
  109.     NEXT a&
  110.   DEFAULT
  111.     FOR a&=95 TO 395 STEP 100
  112.       CIRCLE 400-off_x&,400-off_y&,a&
  113.     NEXT a&
  114.   ENDSELECT
  115.  
  116.  
  117. Added in the procedure @user_on_open:
  118. -------------------------------------
  119.   LOCAL d%
  120.   IF dimmed!=FALSE
  121.     dimmed!=TRUE
  122.     num_lines&=202
  123.     line_w&=90
  124.     DIM txt$(num_lines&)
  125.     OPEN "I",#10,"EX.TXT"
  126.     RECALL #10,txt$(),num_lines&,d%
  127.     CLOSE #10
  128.   ENDIF
  129.  
  130.  
  131. Added in the procedure @user_on_exit:
  132. -------------------------------------
  133.   IF acc&=0
  134.     @vdi_unload_fonts
  135.     ERASE txt$()
  136.   ENDIF
  137.  
  138.  
  139. Added in the procedure @user_win_close_all:
  140. -------------------------------------------
  141.   FOR a&=0 TO max_number_windows&
  142.     IF window_array&(a&,0)>0
  143.       IF window_array&(a&,1)=0
  144.         IF window_array&(a&,8)=42
  145.           @vdi_unload_fonts(window_array&(a&,22))
  146.         ENDIF
  147.       ENDIF
  148.     ENDIF
  149.   NEXT a&
  150.  
  151.  
  152. Added in the function @user_win_close_ok():
  153. -------------------------------------------
  154.   IF userhandle&=42
  155.     @vdi_unload_fonts(window_array&(index&,22))
  156.   ENDIF
  157.  
  158.  
  159. Written spesifically for this demo program:
  160. -------------------------------------------
  161.   PROCEDURE open_text_window
  162.     LOCAL handle&,index&,totw&,toth&,scrlstep&,d&  
  163.     ~GRAF_HANDLE(w&,h&,d&,d&)                      
  164.     totw&=MUL(w&,line_w&)                               
  165.     toth&=MUL(h&,num_lines&)                               
  166.     scrlstep&=h&                                   
  167.     handle&=@win_open(" System font at 10 points ","",menu_in_window%,window_menu&,
  168.                       totw&,toth&,scrlstep&,42,0,0,1200,1200,iconify_icon_1&)
  169.     IF handle&>0                                   
  170.       index&=@win_get_index(handle&)               
  171.       ~@vdi_load_fonts(window_array&(index&,22))
  172.       @vst_alignment(window_array&(index&,22),0,5) 
  173.       window_array&(index&,26)=1                   
  174.       window_array&(index&,27)=10                  
  175.       window_array&(index&,28)=w&                  
  176.       window_array&(index&,29)=h&                 
  177.     ENDIF
  178.   RETURN
  179.  
  180.   PROCEDURE change_font(index&)
  181.     LOCAL id&,size&,wcell&,hcell&,ret%,x&,y&,w&,h&,name$,handle&
  182.     IF index&=-1                        
  183.       ~WIND_GET(0,10,handle&,d&,d&,d&)  
  184.       index&=@win_get_index(handle&)    
  185.     ENDIF
  186.     id&=window_array&(index&,26)        
  187.     size&=window_array&(index&,27)      
  188.     wcell&=window_array&(index&,28)     
  189.     hcell&=window_array&(index&,29)     
  190.     ret%=@xfsl(window_array&(index&,22),"Choose Font",254,name$,id&,size&,wcell&,hcell&)
  191.     IF ret%=1                       
  192.       @win_set_title(index&," "+name$+" "+STR$(size&)+" points ") 
  193.       window_array&(index&,26)=id&       
  194.       window_array&(index&,27)=size      
  195.       window_array&(index&,28)=wcell&    
  196.       window_array&(index&,29)=hcell&     
  197.       @win_change_size(index&,MUL(wcell&,num_lines&),MUL(hcell&,line_w&),hcell&,0)  
  198.       @win_get_workarea(index&,x&,y&,w&,h&)  
  199.       @win_send_redraw(index&,x&,y&,w&,h&)  
  200.     ENDIF
  201.   RETURN
  202.  
  203.  
  204.  
  205.  
  206.  
  207.